#ifndef __GSBATTLEMODE_H__
#define __GSBATTLEMODE_H__

#include "GameState.h"
#include "../Game.h"

class GSBattleMode:GameState
{
public:
	GSBattleMode();
	virtual ~GSBattleMode();
public:
	virtual void OnEnter();
	virtual void Update();
	virtual void Render();
	virtual void OnExit();
private:
	void Attack(Player* pAttack, Player* pReceive);
	void PlayerStatus(Player* pA);
	void KeyUp(EKEY_CODE keyCode);
	bool CheckCollision(Player* pA, EMOVE move);
	void RefreshStage();
	void Move(Player* pA,Player* eA, EMOVE move);
	void RefreshPlayerActions(Player* pA);
	void RefreshPlayerHit(Player* pA);
	void RegenMove(Player* pA);
	void RegenAttack(Player* pA);
	void ResetPlayer(Player* pA);
	bool CheckKO(Player* pA);
	void WorldReposition(Player* pA);
	void MovePlayerAnim(Player* pA);
	void IdlePosition(Player* pA);
	void Reset();

	void RenderPlayerThings(Player* pA);

	void AI_Update(AIPlayer* aiAp, Player* pA);

	int stage[STAGE_ROW][STAGE_COL];

	struct BattleView
	{
		int x,y;
	};

	BattleView m_bvView;

	gui::IGUIFont* fontCustom;
	gui::IGUIFont* fontCustomBig;
	gui::IGUIFont* fontCustomBig2;
	gui::IGUIFont* fontCustom2;
	video::ITexture* sprBattleBG;
	video::ITexture* sprFightScene;

	core::rect<s32> arrowUp;
	core::rect<s32> arrowDown;
	core::rect<s32> arrowLeft;
	core::rect<s32> arrowRight;
	core::rect<s32> arrowHolder;

	core::stringc s_PlayerHP;
	core::stringc s_PlayerMP;
	core::stringc s_Move;
	core::stringc s_Attack;

	bool isButtonDown;
	EKEY_CODE curkey;
	int atkCD;
	int movCD;

	u32 animDeltaTime;
	double fps;
	u32 gameTime;
};

#endif